#include <bits/stdc++.h>

using namespace std;

int n,c[44];
long long dp[800]={1};
int main()
{
    cin>>n;
    int sum = n*(n+1)/2;
    if(sum%2==1){
        cout<<0;
        return 0;
    }
    for(int i=1;i<=n;i++){
        c[i]=i;
        for(int j=sum/2;j>=c[i];j--){
            dp[j] = dp[j] + dp[j-c[i]];
        }
    }
    cout<<dp[sum/2]/2;
    return 0;
}
